import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

  const routes = [
  {
    path:'/',
    name:'home',
    redirect:'/login'
  },
  {
    path:'/home',
    name:'home',
    component:()=>import('../views/home.vue'),
    redirect:'/welcome',
    children:[
      {
        path:'/welcome',
        component:()=>import('../components/welcome.vue')
      },
      {
        path:'/users',
        component:()=>import('../components/users.vue')
      },
      {
        path:'/userss',
        component:()=>import('../components/userss.vue')
      },
      {
        path:'/product',
        component:()=>import('../components/product.vue')
      },
      {
        path:'/producttype',
        component:()=>import('../components/producttype.vue')
      },
      {
        path:'/right',
        component:()=>import('../components/right.vue')
      },
      {
        path:'/rote',
        component:()=>import('../components/rote.vue')
      }
    ],
    meta:{
      requireAuth:true
    }
  },
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/login.vue')
  },
  //先做测试,在将路由添加至指定的页面
 
  
  
  
 
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
